{% extends "base.html" %}
{% block title %}Modificar Item{% endblock %}
{% block body %}
    <script language="javascript" type="text/javascript" src="static/js/datetimepicker.js">
        //Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
        //Script featured on JavaScript Kit (http://www.javascriptkit.com)
        //For this script, visit http://www.javascriptkit.com 
    </script>
    <h2>Modificar Item</h2>
    {% if error %}<div class=error><strong>Error:</strong> {{ error }}</div>{% endif %}
    <form name="" action="" method=post>
        <table>
            <tr>
                <td>(*) Nombre:</td>
                <td><input type=text name=nombre size=30 value="{{ nombre }}"></td>
            </tr>
            <tr>
                <td>(*) Descripci&oacute;n:</td>
                <td><input type=text name=descripcion size=30 value="{{ descripcion }}"></td>
            </tr>
            <tr>
                <td>Observaci&oacute;n:</td>
                <td><input type=text name=observacion size=30 value="{{ observacion }}"></td>
            </tr>
            <tr>
                <td>(*) Complejidad:</td>
                <td><input type=text name=complejidad size=30 value="{{ complejidad }}"></td>
            </tr>
            <tr>
                <td>(*) Costo:</td>
                <td><input type=text name=costo size=30 value="{{ costo }}"></td>
            </tr>
            <tr>
                <td>Tipo de Item: </td>
                <td>{{ tipo_item }}</td>
            </tr>
        </table>
        <fieldset>
        <legend>Atributos</legend>
            <table>
                {% for atributo in atributos %}
                <tr>
                    <td>{% if atributo.obligatorio == 'S' %} (*) {% endif %} {{ atributo.nombre }}</td>
                    <td><input type=text name={{ atributo.id }} id="{{atributo.id}}" size=30 value="{{ atributo.valor }}"></td>
                    {% if atributo.tipo == 3 %} <td><a href="javascript:NewCal('{{atributo.id}}','DDMMYYYY',false,24)"><img src="static/images/cal.gif" width="16" height="16" border="0" alt="Seleccione una fecha"></a></td> {% endif %}
                </tr>
                {% endfor %}
            </table>
        </fieldset>
        <table>
            <tr>(*) Datos requeridos</tr>
            <tr>
                <td><input type=submit name="action" value="Guardar"></td>
                <td><button type=submit name="action" value="Salir" onclick="return confirm('Los datos no serán almacenados');">Cancelar</button></td>
            </tr>
        </table>
</form>
{% endblock %}
